<?php
        
	if (isset($_GET["id"])){
                //evitamos los sql injections
                $id = mysql_real_escape_string($_GET["id"]);
                //nos conectamos a la BD
                $link = mysql_connect('localhost', 'root', 'root');
                //seleccionamos nuestra BD
		mysql_select_db('mastergoal', $link) or die('Could not select database.');
                
		if (!$link) {
                    die('Could not connect: ' . mysql_error());
                }else{
                    $result = mysql_query("SELECT photo_data FROM equipos WHERE equipo = '".$id."'");
                    
                    //header ("Content-Type: application/image/jpeg");
                    //header("Content-length: " . strlen($data) . "\r\n" );
	            $row = mysql_fetch_array($result, MYSQL_NUM);

		    echo $row[0];
                    mysql_free_result($result);
                    
                }
                
                mysql_close($link);
                
                
	}

?>
